package cn.edu.scau.cmi.linzhanyi.simpleFactoryMethod;

import cn.edu.scau.cmi.linzhanyi.domain.BodyInsurance;
import cn.edu.scau.cmi.linzhanyi.domain.CarInsurance;
import cn.edu.scau.cmi.linzhanyi.domain.Insurance;
import cn.edu.scau.cmi.linzhanyi.domain.MultipleAccidents;
import cn.edu.scau.cmi.linzhanyi.domain.PeopleInsurance;

public class SimpleFactory {
    public static Insurance get(String type){
        switch (type){
            case "驾驶员身体受伤":return new BodyInsurance();
            case "汽车损坏" :return new CarInsurance();
            case "人员伤亡" :return new PeopleInsurance();
            case "多种事故" :return new MultipleAccidents();

        }
        return null;
    }

}
